package com.example.thirdstage_project.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.thirdstage_project.entity.Unit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


@Mapper
public interface UnitDao extends BaseMapper<Unit> {
    @Select("select uid from user where password=#{oldPass}")
    int selectuid(String oldPass);

    @Update("update user set password=#{password} where uid=#{uid} ")
    int updatePassword(String password,int uid);

    @Select("select unitname,address,corporation,investment,type,tel,email, fax,zipcode,introduction from unit ")
    List<Unit>select();

    @Select("select categoryname from project_category where categoryname like '%${name}%' ")
    String search(String name);


}
